package per.brant.template.rest

import net.liftweb.http.rest.RestHelper
import net.liftweb.http.{Req, GetRequest}
import per.brant.template.service.PonyService
import net.liftweb.json.Extraction

/**
 * Created by brantyan on 14-1-16.
 */
object PonyRest extends RestHelper{

  serve{
    case Req("rest"::"pony"::"best"::Nil,_,GetRequest)=>
      PonyService.getRandomPony.map(pony => Extraction.decompose(pony))
  }
}
